package com.ylr.base.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-06-30 09:53:31
 * className: AesEnum
 * version: 1.0
 * description:
 */
@Getter
@AllArgsConstructor
public enum AesEnum {

    PLAIN(0, "明文"), HEX(1, "hex密文"), BASE64(2, "base64密文"),

    ;

    /**
     * 值
     */
    private final Integer value;

    /**
     * 名称
     */
    private final String name;

    /**
     * 获取AES操作类型枚举对象
     * @param value 参数值
     * @return 枚举对象
     */
    public static AesEnum getAesTypeEnum(Integer value) {
        if (HEX.value.equals(value)) {
            return HEX;
        }
        if (BASE64.value.equals(value)) {
            return BASE64;
        }
        return null;
    }

}
